<template>
  <el-form :model="editFormObj" 
  :rules="editFormRule" 
  ref="editFormRef" 
  label-width="100px">

    <!-- 级联选择框 -->
    <el-form-item label="省/市区县" prop="cityData">
      <order-city-cascader :editFormObj="editFormObj"></order-city-cascader>
    </el-form-item>

    <!-- input -->
    <el-form-item label="详细地址" prop="detailCityInfo">
      <el-input v-model="editFormObj.detailCityInfo"></el-input>
    </el-form-item>

  </el-form>
</template>

<script>
// 组件
  import OrderCityCascader from '@/views/Main/order/orderCompent/OrderCityCascader';
export default {
  data() {
    return {
      editFormObj: { // 表单绑定数据
        cityData: [], // 大概地址
        detailCityInfo: '', // 详细地址
      },
      editFormRule: { // 表单规则
        cityData: [
          { type: 'array', required: true, message: '请选择市县区', trigger: 'change' }
        ],
        detailCityInfo: [{ required: true, message: '请输入详细地址', trigger: 'blur' }]
      }
    }
  },
  methods: {
    editFormRest() { // 表单清空方法
      this.$refs['editFormRef'].resetFields();
    }
  },
  components: {
    OrderCityCascader
  },
  created() {
    this.$bus.$on('editFormRest', this.editFormRest);
  },
  destroyed() {
    this.$bus.$off('editFormRest');
  }

}
</script>

<style>

</style>